<template>
	<view class="x-wrapper">
		<view class="x-main-content">
			<u-navbar title="选择科室" bgColor="#fff" :fixed="true" leftIconColor="#333" leftIconSize="42rpx" autoBack
				placeholder>
			</u-navbar>
			<u-sticky>
				<view class="top-box">
					<view class="search-box">
						<u-search placeholder="搜索医院科室" :showAction="false" height="64rpx" placeholderStyle="color:#777"
							:searchIconSize="20" searchIconColor="#999" bgColor="#F3F4F9" color="#333"
							:inputStyle="searchInputStyle" v-model="params.name" @search="resetLoad"
							@clear="resetLoad"></u-search>
						<view class="s-btn">
							<u-button text="搜索" :hairline="false" :customStyle="searchBtnStyle" shape="circle"
								color="#386FFF" @click="resetLoad"></u-button>
						</view>
					</view>
				</view>
			</u-sticky>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				params: {
					cityCode: '',
					name: '',
					pageNum: 1,
					pageSize: 20
				},
			}
		},
		created() {
			this.getDepartmentList()
		},
		methods: {
			async getDepartmentList() {
				// let id = this.$store.state.hospitalSelection.id
				let hospital1 = uni.getStorageSync('hospital')
				let res = await this.$request('/api/index/getHospitalDetail/' + hospital1.id, '', 'GET')
				console.log(res)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top-box {
		padding: 20rpx 40rpx 30rpx;
		background: #fff;

		.search-box {
			height: 64rpx;
			background: #F8FAFF;
			border-radius: 64rpx;
			display: flex;
			align-items: center;
			// margin-bottom: 24rpx;

			.s-btn {
				margin-right: 5rpx;
				width: 118rpx;
				height: 54rpx;

				/deep/ .u-button__text {
					font-size: 24rpx !important;
				}
			}
		}
	}
</style>